import QtQuick 2.0
import QtQuick.Controls 2.5
import QtQuick.Controls 1.4

import "../../../commonUI"
import "../../../basic"

// 系统
Item {

    anchors.left: parent.left
    anchors.right: parent.right
    height: 200
    Label {
        id: sysTitleLabel
        text: qsTr("系统")
        font.pixelSize: 22
        font.bold: true
        font.family: BasicConfig.heiTiFont
        anchors.left: parent.left
        color: "white"
    }
    // 定时关闭
    Item {
        id: timerCloseItems
        anchors.left: sysTitleLabel.right
        anchors.right: parent.right
        height: 150
        anchors.leftMargin: 150
        Column {
            anchors.fill: parent
            spacing: 20
            CustomCheckBox {
                id: sysCbx
                width: 100
                height: 30
                textColor: "white"
                anchors.left: parent.left
                text: qsTr("开启定时关闭软件")
            }
            Row {
                spacing: 10
                anchors.left: parent.left
                Label {
                    text: qsTr("剩余关闭时间")
                    font.pixelSize: 18
                    font.bold: true
                    font.family: BasicConfig.heiTiFont
                    color: "#ddd"
                    verticalAlignment: Text.AlignVCenter
                    anchors.verticalCenter: parent.verticalCenter
                }
                CustomComboBox {
                    text: "0"
                    height: 30
                    width: 150
                    model: ListModel { }
                    anchors.verticalCenter: parent.verticalCenter
                    Component.onCompleted: {
                        for (let i = 0; i < 24; ++i) {
                            model.append({"modelData":i});
                        }
                    }
                }
                Label {
                    text: qsTr("小时")
                    font.pixelSize: 18
                    font.bold: true
                    font.family: BasicConfig.heiTiFont
                    color: "#ddd"
                    verticalAlignment: Text.AlignVCenter
                    anchors.verticalCenter: parent.verticalCenter
                }
                CustomComboBox {
                    text: "0"
                    height: 30
                    width: 150
                    model: ListModel { }
                    anchors.verticalCenter: parent.verticalCenter
                    Component.onCompleted: {
                        for (let i = 0; i < 60; ++i) {
                            model.append({"modelData":i});
                        }
                    }
                }
                Label {
                    text: qsTr("分钟")
                    font.pixelSize: 18
                    font.bold: true
                    font.family: BasicConfig.heiTiFont
                    color: "#ddd"
                    verticalAlignment: Text.AlignVCenter
                    anchors.verticalCenter: parent.verticalCenter
                }
            }
            CustomCheckBox {
                id: sysShutDownCbx
                width: 100
                height: 30
                textColor: "white"
                anchors.left: parent.left
                enabled: false
                text: qsTr("关闭软件时同时关机")
            }
        }
    }

    Row {
        id: closePanRow
        anchors.left: timerCloseItems.left
        anchors.top: timerCloseItems.bottom
        spacing: 30
        Label {
            id: closeLabel
            text: qsTr("关闭主面板")
            font.pixelSize: 20
            font.bold: true
            font.family: BasicConfig.heiTiFont
            color: "#ddd"
        }

        ExclusiveGroup {
            id: closePanExclusiveGroup
        }
        CustomRadioButton {
            contentText: qsTr("最小化到系统托盘")
            exclusiveGroup: closePanExclusiveGroup
        }
        CustomRadioButton {
            contentText: qsTr("退出云音乐")
            exclusiveGroup: closePanExclusiveGroup
        }
    }

    CustomPliteLine { }
}
